package com.web.servlet;

import com.web.entity.Student;
import com.web.service.StudentService;
import com.web.serviceimpl.StudentServiceImpl;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 *
 * @author 17612
 */
@WebServlet("/msps")
public class ModifyStudentPwdServlet extends HttpServlet{
    StudentService studentService = new StudentServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setCharacterEncoding("utf-8");
        String Sid = req.getParameter("Sid");
        String Spwd= req.getParameter("Spwd");
        
        Student student = new Student(Sid,Spwd);
        
        int rows = studentService.modifyStudentPwd(student);
        
        
        resp.getWriter().print(rows);
        PrintWriter out=resp.getWriter();
        System.out.println(rows);
    }
    
    
    

   
    
}
